<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增文件管理')"/>
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-file-add">
        <div class="form-group">
            <label class="col-sm-3 control-label">文件名称：</label>
            <div class="col-sm-8">
                <input name="fileName" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">密码：</label>
            <div class="col-sm-8">
                <input name="fileSecurity" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否设置密码：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('file_is_security')}">
                    <input type="radio" th:id="${'fileIsSecurity_' + dict.dictCode}" name="fileIsSecurity"
                           th:value="${dict.dictValue}" th:checked="${dict.default}">
                    <label th:for="${'fileIsSecurity_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">图片上传：</label>
            <div class="col-sm-8">
                <div class="fileinput fileinput-new" data-provides="fileinput">
                    <div class="fileinput-preview thumbnail" data-trigger="fileinput"
                         style="width: 200px; height: 150px;">
                        <img id="imgId" style="display: none;width: 200px; height: 139px;">
                    </div>
                    <div>
                        <span class="btn btn-white btn-file">
                            <span class="fileinput-new">选择图片</span>
                            <input id="inputId" type="file" name="file"
                                   onchange="uploadFile('inputId','inputHiddenName','imgId')">
                            <input type="hidden" name="inputHiddenName" id="inputHiddenName">
                        </span>
                        <a href="javascript:void(0);" class="btn btn-white fileinput-exists"
                           onclick="cleanFile('imgId','inputHiddenName')">清除</a>
                    </div>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">文件大小：</label>
            <div class="col-sm-8">
                <input name="fileSize" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">删除标志：</label>
            <div class="col-sm-8">
                <input name="delFlag" class="form-control" type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script src="../static/ruoyi/register.js" th:src="@{/ruoyi/ruoyi-upload.js}"></script>
<script th:inline="javascript">
    var prefix = ctx + "system/file"
    $("#form-file-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-file-add').serialize());
        }
    }


</script>
</body>
</html>